/**
 * Copyright (C) 2018-2021
 * All rights reserved, Designed By www.yixiang.co

 */
package co.yixiang.modules.order.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import co.yixiang.domain.BaseDomain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
* @author hupeng
* @date 2020-05-12
*/

@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("yx_store_order")
public class YxStoreOrder extends BaseDomain {

    /** 订单ID */
    @TableId
    private Long id;


    /** 订单号 */
    private String orderId;


    /** 额外订单号 */
    private String extendOrderId;


    /** 用户id */
    private Long uid;


    /** 用户姓名 */
    private String realName;


    /** 用户电话 */
    private String userPhone;


    /** 详细地址 */
    private String userAddress;


    /** 购物车id */
    private String cartId;


    /** 运费金额 */
    private BigDecimal freightPrice;


    /** 订单商品总数 */
    private Integer totalNum;


    /** 订单总价 */
    private BigDecimal totalPrice;


    /** 邮费 */
    private BigDecimal totalPostage;


    /** 实际支付金额 */
    private BigDecimal payPrice;


    /** 支付邮费 */
    private BigDecimal payPostage;


    /** 抵扣金额 */
    private BigDecimal deductionPrice;


    /** 优惠券id */
    private Integer couponId;


    /** 优惠券金额 */
    private BigDecimal couponPrice;


    /** 支付状态 */
    private Integer paid;


    /** 支付时间 */
    private Date payTime;


    /** 支付方式 */
    private String payType;


    /** 订单状态（-1 : 申请退款 -2 : 退货成功 0：待发货；1：待收货；2：已收货；3：待评价；-1：已退款） */
    private Integer status;


    /** 0 未退款 1 申请中 2 已退款 */
    private Integer refundStatus;


    /** 退款图片 */
    private String refundReasonWapImg;


    /** 退款用户说明 */
    private String refundReasonWapExplain;


    /** 退款时间 */
    private Date refundReasonTime;


    /** 前台退款原因 */
    private String refundReasonWap;


    /** 不退款的理由 */
    private String refundReason;


    /** 退款金额 */
    private BigDecimal refundPrice;


    /** 快递公司编号 */
    private String deliverySn;


    /** 快递名称/送货人姓名 */
    private String deliveryName;


    /** 发货类型 */
    private String deliveryType;


    /** 快递单号/手机号 */
    private String deliveryId;


    /** 消费赚取积分 */
    private BigDecimal gainIntegral;


    /** 使用积分 */
    private BigDecimal useIntegral;


    /** 给用户退了多少积分 */
    private BigDecimal backIntegral;


    /** 备注 */
    private String mark;



    /** 唯一id(md5加密)类似id */
     @TableField(value = "`unique`")
    private String unique;


    /** 管理员备注 */
    private String remark;


    /** 商户ID */
    private Integer merId;


    private Integer isMerCheck;


    /** 拼团产品id0一般产品 */
    private Long combinationId;


    /** 拼团id 0没有拼团 */
    private Long pinkId;


    /** 成本价 */
    private BigDecimal cost;


    /** 秒杀产品ID */
    private Long seckillId;


    /** 砍价id */
    private Long bargainId;


    /** 核销码 */
    private String verifyCode;


    /** 门店id */
    private Integer storeId;


    /** 配送方式 1=快递 ，2=门店自提 */
    private Integer shippingType;


    /** 支付渠道(0微信公众号1微信小程序) */
    private Integer isChannel;


    private Integer isRemind;


    private Integer isSystemDel;

    @ApiModelProperty(value = "实际支付积分")
    private BigDecimal payIntegral;

    public static YxStoreOrderBuilder builder() {
        return new YxStoreOrderBuilder();
    }

    public void copy(YxStoreOrder source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static class YxStoreOrderBuilder {
        private Long id;
        private String orderId;
        private String extendOrderId;
        private Long uid;
        private String realName;
        private String userPhone;
        private String userAddress;
        private String cartId;
        private BigDecimal freightPrice;
        private Integer totalNum;
        private BigDecimal totalPrice;
        private BigDecimal totalPostage;
        private BigDecimal payPrice;
        private BigDecimal payPostage;
        private BigDecimal deductionPrice;
        private Integer couponId;
        private BigDecimal couponPrice;
        private Integer paid;
        private Date payTime;
        private String payType;
        private Integer status;
        private Integer refundStatus;
        private String refundReasonWapImg;
        private String refundReasonWapExplain;
        private Date refundReasonTime;
        private String refundReasonWap;
        private String refundReason;
        private BigDecimal refundPrice;
        private String deliverySn;
        private String deliveryName;
        private String deliveryType;
        private String deliveryId;
        private BigDecimal gainIntegral;
        private BigDecimal useIntegral;
        private BigDecimal backIntegral;
        private String mark;
        private String unique;
        private String remark;
        private Integer merId;
        private Integer isMerCheck;
        private Long combinationId;
        private Long pinkId;
        private BigDecimal cost;
        private Long seckillId;
        private Long bargainId;
        private String verifyCode;
        private Integer storeId;
        private Integer shippingType;
        private Integer isChannel;
        private Integer isRemind;
        private Integer isSystemDel;
        private BigDecimal payIntegral;

        YxStoreOrderBuilder() {
        }

        public YxStoreOrderBuilder id(Long id) {
            this.id = id;
            return this;
        }

        public YxStoreOrderBuilder orderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public YxStoreOrderBuilder extendOrderId(String extendOrderId) {
            this.extendOrderId = extendOrderId;
            return this;
        }

        public YxStoreOrderBuilder uid(Long uid) {
            this.uid = uid;
            return this;
        }

        public YxStoreOrderBuilder realName(String realName) {
            this.realName = realName;
            return this;
        }

        public YxStoreOrderBuilder userPhone(String userPhone) {
            this.userPhone = userPhone;
            return this;
        }

        public YxStoreOrderBuilder userAddress(String userAddress) {
            this.userAddress = userAddress;
            return this;
        }

        public YxStoreOrderBuilder cartId(String cartId) {
            this.cartId = cartId;
            return this;
        }

        public YxStoreOrderBuilder freightPrice(BigDecimal freightPrice) {
            this.freightPrice = freightPrice;
            return this;
        }

        public YxStoreOrderBuilder totalNum(Integer totalNum) {
            this.totalNum = totalNum;
            return this;
        }

        public YxStoreOrderBuilder totalPrice(BigDecimal totalPrice) {
            this.totalPrice = totalPrice;
            return this;
        }

        public YxStoreOrderBuilder totalPostage(BigDecimal totalPostage) {
            this.totalPostage = totalPostage;
            return this;
        }

        public YxStoreOrderBuilder payPrice(BigDecimal payPrice) {
            this.payPrice = payPrice;
            return this;
        }

        public YxStoreOrderBuilder payPostage(BigDecimal payPostage) {
            this.payPostage = payPostage;
            return this;
        }

        public YxStoreOrderBuilder deductionPrice(BigDecimal deductionPrice) {
            this.deductionPrice = deductionPrice;
            return this;
        }

        public YxStoreOrderBuilder couponId(Integer couponId) {
            this.couponId = couponId;
            return this;
        }

        public YxStoreOrderBuilder couponPrice(BigDecimal couponPrice) {
            this.couponPrice = couponPrice;
            return this;
        }

        public YxStoreOrderBuilder paid(Integer paid) {
            this.paid = paid;
            return this;
        }

        public YxStoreOrderBuilder payTime(Date payTime) {
            this.payTime = payTime;
            return this;
        }

        public YxStoreOrderBuilder payType(String payType) {
            this.payType = payType;
            return this;
        }

        public YxStoreOrderBuilder status(Integer status) {
            this.status = status;
            return this;
        }

        public YxStoreOrderBuilder refundStatus(Integer refundStatus) {
            this.refundStatus = refundStatus;
            return this;
        }

        public YxStoreOrderBuilder refundReasonWapImg(String refundReasonWapImg) {
            this.refundReasonWapImg = refundReasonWapImg;
            return this;
        }

        public YxStoreOrderBuilder refundReasonWapExplain(String refundReasonWapExplain) {
            this.refundReasonWapExplain = refundReasonWapExplain;
            return this;
        }

        public YxStoreOrderBuilder refundReasonTime(Date refundReasonTime) {
            this.refundReasonTime = refundReasonTime;
            return this;
        }

        public YxStoreOrderBuilder refundReasonWap(String refundReasonWap) {
            this.refundReasonWap = refundReasonWap;
            return this;
        }

        public YxStoreOrderBuilder refundReason(String refundReason) {
            this.refundReason = refundReason;
            return this;
        }

        public YxStoreOrderBuilder refundPrice(BigDecimal refundPrice) {
            this.refundPrice = refundPrice;
            return this;
        }

        public YxStoreOrderBuilder deliverySn(String deliverySn) {
            this.deliverySn = deliverySn;
            return this;
        }

        public YxStoreOrderBuilder deliveryName(String deliveryName) {
            this.deliveryName = deliveryName;
            return this;
        }

        public YxStoreOrderBuilder deliveryType(String deliveryType) {
            this.deliveryType = deliveryType;
            return this;
        }

        public YxStoreOrderBuilder deliveryId(String deliveryId) {
            this.deliveryId = deliveryId;
            return this;
        }

        public YxStoreOrderBuilder gainIntegral(BigDecimal gainIntegral) {
            this.gainIntegral = gainIntegral;
            return this;
        }

        public YxStoreOrderBuilder useIntegral(BigDecimal useIntegral) {
            this.useIntegral = useIntegral;
            return this;
        }

        public YxStoreOrderBuilder backIntegral(BigDecimal backIntegral) {
            this.backIntegral = backIntegral;
            return this;
        }

        public YxStoreOrderBuilder mark(String mark) {
            this.mark = mark;
            return this;
        }

        public YxStoreOrderBuilder unique(String unique) {
            this.unique = unique;
            return this;
        }

        public YxStoreOrderBuilder remark(String remark) {
            this.remark = remark;
            return this;
        }

        public YxStoreOrderBuilder merId(Integer merId) {
            this.merId = merId;
            return this;
        }

        public YxStoreOrderBuilder isMerCheck(Integer isMerCheck) {
            this.isMerCheck = isMerCheck;
            return this;
        }

        public YxStoreOrderBuilder combinationId(Long combinationId) {
            this.combinationId = combinationId;
            return this;
        }

        public YxStoreOrderBuilder pinkId(Long pinkId) {
            this.pinkId = pinkId;
            return this;
        }

        public YxStoreOrderBuilder cost(BigDecimal cost) {
            this.cost = cost;
            return this;
        }

        public YxStoreOrderBuilder seckillId(Long seckillId) {
            this.seckillId = seckillId;
            return this;
        }

        public YxStoreOrderBuilder bargainId(Long bargainId) {
            this.bargainId = bargainId;
            return this;
        }

        public YxStoreOrderBuilder verifyCode(String verifyCode) {
            this.verifyCode = verifyCode;
            return this;
        }

        public YxStoreOrderBuilder storeId(Integer storeId) {
            this.storeId = storeId;
            return this;
        }

        public YxStoreOrderBuilder shippingType(Integer shippingType) {
            this.shippingType = shippingType;
            return this;
        }

        public YxStoreOrderBuilder isChannel(Integer isChannel) {
            this.isChannel = isChannel;
            return this;
        }

        public YxStoreOrderBuilder isRemind(Integer isRemind) {
            this.isRemind = isRemind;
            return this;
        }

        public YxStoreOrderBuilder isSystemDel(Integer isSystemDel) {
            this.isSystemDel = isSystemDel;
            return this;
        }

        public YxStoreOrderBuilder payIntegral(BigDecimal payIntegral) {
            this.payIntegral = payIntegral;
            return this;
        }

        public YxStoreOrder build() {
            return new YxStoreOrder(id, orderId, extendOrderId, uid, realName, userPhone, userAddress, cartId, freightPrice, totalNum, totalPrice, totalPostage, payPrice, payPostage, deductionPrice, couponId, couponPrice, paid, payTime, payType, status, refundStatus, refundReasonWapImg, refundReasonWapExplain, refundReasonTime, refundReasonWap, refundReason, refundPrice, deliverySn, deliveryName, deliveryType, deliveryId, gainIntegral, useIntegral, backIntegral, mark, unique, remark, merId, isMerCheck, combinationId, pinkId, cost, seckillId, bargainId, verifyCode, storeId, shippingType, isChannel, isRemind, isSystemDel, payIntegral);
        }

        public String toString() {
            return "YxStoreOrder.YxStoreOrderBuilder(id=" + this.id + ", orderId=" + this.orderId + ", extendOrderId=" + this.extendOrderId + ", uid=" + this.uid + ", realName=" + this.realName + ", userPhone=" + this.userPhone + ", userAddress=" + this.userAddress + ", cartId=" + this.cartId + ", freightPrice=" + this.freightPrice + ", totalNum=" + this.totalNum + ", totalPrice=" + this.totalPrice + ", totalPostage=" + this.totalPostage + ", payPrice=" + this.payPrice + ", payPostage=" + this.payPostage + ", deductionPrice=" + this.deductionPrice + ", couponId=" + this.couponId + ", couponPrice=" + this.couponPrice + ", paid=" + this.paid + ", payTime=" + this.payTime + ", payType=" + this.payType + ", status=" + this.status + ", refundStatus=" + this.refundStatus + ", refundReasonWapImg=" + this.refundReasonWapImg + ", refundReasonWapExplain=" + this.refundReasonWapExplain + ", refundReasonTime=" + this.refundReasonTime + ", refundReasonWap=" + this.refundReasonWap + ", refundReason=" + this.refundReason + ", refundPrice=" + this.refundPrice + ", deliverySn=" + this.deliverySn + ", deliveryName=" + this.deliveryName + ", deliveryType=" + this.deliveryType + ", deliveryId=" + this.deliveryId + ", gainIntegral=" + this.gainIntegral + ", useIntegral=" + this.useIntegral + ", backIntegral=" + this.backIntegral + ", mark=" + this.mark + ", unique=" + this.unique + ", remark=" + this.remark + ", merId=" + this.merId + ", isMerCheck=" + this.isMerCheck + ", combinationId=" + this.combinationId + ", pinkId=" + this.pinkId + ", cost=" + this.cost + ", seckillId=" + this.seckillId + ", bargainId=" + this.bargainId + ", verifyCode=" + this.verifyCode + ", storeId=" + this.storeId + ", shippingType=" + this.shippingType + ", isChannel=" + this.isChannel + ", isRemind=" + this.isRemind + ", isSystemDel=" + this.isSystemDel + ", payIntegral=" + this.payIntegral + ")";
        }
    }
}
